#include <iostream>
#include <cmath>
using namespace std;
struct rationalNumber{
    int fenzi; // 分子
    int fenmu; // 分母
};
rationalNumber rnAdd(rationalNumber x, rationalNumber y);
rationalNumber reduction(rationalNumber n);
int gcd(int, int);

// 函数rnMean：计算n个有理数的平均数
// 参数：a-存放有理数的数组,n-有理数的个数
// 返回值：n个有理数的平均数
rationalNumber rnMean(rationalNumber a[], int n);

int main()
{
    char c;
    rationalNumber a[100],z;
    int n, i;
    cin >> n;     // 输入有理数个数
    // 输入n个有理数
    for(i = 0; i < n; i++)
        cin >> a[i].fenzi >> c >> a[i].fenmu;
    z = rnMean(a,n);     // 计算有理数平均数
    // 输出平均数
    if(z.fenmu == 1)
        cout << z.fenzi << endl;
    else
        cout << z.fenzi << "/" << z.fenmu << endl;
    return 0;
}

// 请在此添加代码，实现函数rnMean
/********** Begin *********/
rationalNumber rnMean(rationalNumber a[], int n)
{
    rationalNumber avg = a[0];
    for (int i = 1; i < n; i++) {
        avg = rnAdd(avg, a[i]);
    }
    avg.fenmu = avg.fenmu * n;
    avg = reduction(avg);
    return avg;
}
/********** End **********/
rationalNumber rnAdd(rationalNumber x, rationalNumber y)
{
    rationalNumber temp;
    temp.fenmu = x.fenmu * y.fenmu;
    temp.fenzi = x.fenmu * y.fenzi + x.fenzi * y.fenmu;
    temp = reduction(temp);
    return temp;
}
/********** End **********/

rationalNumber reduction(rationalNumber n)
{
    // 请在这里补充代码，实现函数reduction
    /********** Begin *********/
    
    if (n.fenmu * n.fenzi < 0) {
    	n.fenzi = -abs(n.fenzi);
    	n.fenmu = abs(n.fenmu);
	}
	int gcd1 = gcd(abs(n.fenzi),abs(n.fenmu));
	n.fenmu = n.fenmu / gcd1;
	n.fenzi = n.fenzi / gcd1; 
	
    return n;

    
    /********** End **********/
}

int gcd(int a, int b) {
	if (a % b == 0) {
		return b;
	}
	return gcd(b,a % b);
}